String.prototype.format = function () {
    if (arguments.length == 0) return this;
    var param = arguments[0];
    var s = this;
    if (typeof(param) == 'object') {
        for (var key in param)
            s = s.replace(new RegExp("\\{" + key + "\\}", "g"), param[key]);
        return s;
    } else {
        for (var i = 0; i < arguments.length; i++)
            s = s.replace(new RegExp("\\{" + i + "\\}", "g"), arguments[i]);
        return s;
    }
};
mInfo = {
    getPath: function () {
        var pathName = document.location.pathname;
        var index = pathName.substr(1).indexOf("/");
        var result = pathName.substr(0, index + 1);
        return result;
    },
    getRealPath: function () {
        var localObj = window.location;
        var contextPath = localObj.pathname.split("/")[1];
        var basePath = localObj.protocol + "//" + localObj.host + "/" + contextPath;
        return basePath;
    },
    getJsPath: function (js) {
        var scripts = document.getElementsByTagName("script");
        var path = "";
        for (var i = 0, l = scripts.length; i < l; i++) {
            var src = scripts[i].src;
            if (src.indexOf(js) != -1) {
                var ss = src.split(js);
                path = ss[0];
                break;
            }
        }
        var href = location.href;
        href = href.split("#")[0];
        href = href.split("?")[0];
        var ss = href.split("/");
        ss.length = ss.length - 1;
        href = ss.join("/");
        if (path.indexOf("https:") == -1 && path.indexOf("http:") == -1 && path.indexOf("file:") == -1 && path.indexOf("\/") != 0) {
            path = href + "/" + path;
        }
        return path;
    }
};
var mPath = mInfo.getJsPath("boot.js");
mWrite = {
    pLin: '<link href="{0}{1}" rel="stylesheet" type="text/css" >',
    pSpt: '<script src="{0}{1}" type="text/javascript"></script>',
    lin: function () {
        Array.from(arguments).forEach(function (v) {
            document.write(mWrite.pLin.format(mPath, v));
        });
    },
    spt: function () {
        Array.from(arguments).forEach(function (v) {
            document.write(mWrite.pSpt.format(mPath, v));
        });
    }
};
mWrite.lin('libs/css/font-awesome.min.css', 'css/froala_editor.css', 'css/froala_style.css', 'css/plugins/code_view.css', 'css/plugins/colors.css', 'css/plugins/emoticons.css', 'css/plugins/image_manager.css', 'css/plugins/image.css', 'css/plugins/line_breaker.css', 'css/plugins/table.css', 'css/plugins/char_counter.css', 'css/plugins/video.css', 'libs/css/codemirror.min.css');
mWrite.spt('libs/js/codemirror.min.js', 'libs/js/xml.min.js', 'js/froala_editor.min.js', 'js/plugins/align.min.js', 'js/plugins/code_beautifier.min.js', 'js/plugins/code_view.min.js', 'js/plugins/colors.min.js', 'js/plugins/draggable.min.js', 'js/plugins/draggable.min.js', 'js/plugins/emoticons.min.js', 'js/plugins/font_size.min.js', 'js/plugins/font_family.min.js', 'js/plugins/image.min.js', 'js/plugins/image_manager.min.js', 'js/plugins/line_breaker.min.js', 'js/plugins/link.min.js', 'js/plugins/lists.min.js', 'js/plugins/paragraph_format.min.js', 'js/plugins/paragraph_style.min.js', 'js/plugins/table.min.js', 'js/plugins/video.min.js', 'js/plugins/url.min.js', 'js/plugins/line_breaker.min.js', 'js/plugins/link.min.js', 'js/plugins/lists.min.js', 'js/plugins/paragraph_format.min.js', 'js/plugins/paragraph_style.min.js', 'js/plugins/table.min.js', 'js/plugins/video.min.js', 'js/plugins/url.min.js', 'js/plugins/entities.min.js', 'js/plugins/char_counter.min.js', 'js/plugins/inline_style.min.js', 'js/plugins/save.min.js', 'js/languages/zh_cn.js');